package edu.chinasoft.servlet;

import java.io.IOException;
import java.io.PrintWriter;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.log4j.Logger;

/**
 * Servlet implementation class Servelt01
 */
@WebServlet(name="myServelt01",value="/servlet/Servelt01")
public class Servelt01 extends HttpServlet {
	private static Logger logger = Logger.getLogger(Servelt01.class);
	/**
	 * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)
	 */
    public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		// TODO Auto-generated method stub
    	logger.debug(" Servelt01 >doGet start.......");
    	response.setContentType("text/html;charset=utf-8");
    	request.setCharacterEncoding("utf-8");
    	PrintWriter out = response.getWriter();
    	out.write("我是欢迎界面！");
    	logger.debug(" Servelt01 >doGet end.......");
	}

	/**
	 * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response)
	 */
    public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		// TODO Auto-generated method stub
    	logger.debug(" Servelt01 >doPost start.......");
    	this.doGet(request, response);
    	logger.debug(" Servelt01 >doPost end.......");
	}

}
